import yaml

class Myyaml():
    def __init__(self,file,encoding):
        self.file = file
        self.encoding =encoding
    def read(self):
        with open(self.file,encoding=self.encoding) as f:
            data = yaml.load(f.read(),Loader=yaml.FullLoader)
        return data

if __name__ == '__main__':
    ya = Myyaml('../config2.yaml',"utf-8")
    print(ya.read())